<template name="navigation">
    <nav class="navbar-default navbar-static-side " role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav metismenu" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear">
                                {{#if isConnected}}
                                    <span class="block m-t-xs"> <strong
                                            class="font-bold">{{getConnection.connectionName}}</strong>
                                </span>
                                <span class="block m-t-xs">
                                    {{{getServerList}}}
                                </span>
                                    <span class="text-muted text-xs block">{{getConnection.databaseName}} <b
                                            class="caret"></b>
                                    </span>
                                {{else}}
                                    <span class="block mt-xs">{{_ "not_connected"}}</span>
                                {{/if}}
                            </span>
                        </a>
                        {{#if isConnected}}
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a id="btnRefreshCollections" href="#"><i class="fa fa-refresh"></i> {{_ "refresh_collections"}}</a></li>
                                <li><a id="btnSwitchDatabase2" href="#"><i class="fa fa-database"></i> {{_ "switch_database"}}</a></li>
                                <li><a id="btnDropDatabase" href="#"><i class="fa fa-remove"></i> {{_ "drop_database"}}</a>
                                </li>
                                <li><a id="btnDropAllCollections" href="#"><i class="fa fa-remove"></i> {{_ "drop_all_collections"}}</a></li>

                                <!--
                                <li class="divider"></li>
                                <li><a href="#">Item</a></li>-->
                            </ul>
                        {{/if}}
                    </div>
                    <div class="logo-element">
                        MC+
                    </div>
                </li>
                {{#if isConnected}}
                    <li class="{{isActivePath regex='databaseStats'}}">
                        <a class="aNavigations" href="{{pathFor route='databaseStats'}}"><i
                                class="fa fa-eye"></i> <span
                                class="nav-label">{{_ "db_stats"}}</span>
                        </a>
                    </li>

                    <li>
                        <a href=""><i
                                class="fa fa-wrench"></i> <span
                                class="nav-label">{{_ "management"}}</span>
                            <span class="fa arrow"></span>
                        </a>

                        <ul class="nav nav-second-level collapse out">
                            <li class="{{isActivePath regex='userManagement'}}">
                                <a class="aNavigations" href="{{pathFor route='userManagement'}}"><i
                                        class="fa fa-user"></i> <span
                                        class="nav-label">{{_ "user_management"}}</span>
                                </a>
                            </li>

                            <li class="{{isActivePath regex='databaseDumpRestore'}}">
                                <a id="anchorDatabaseDumpRestore" href="{{pathFor route='databaseDumpRestore'}}"
                                   class="aNavigations"><i
                                        class="fa fa-download"></i> <span
                                        class="nav-label">{{_ "dump_restore"}}</span>
                                </a>
                            </li>

                            <li class="{{isActivePath regex='fileManagement'}}">
                                <a class="aNavigations" href="{{pathFor route='fileManagement'}}"><i
                                        class="fa fa-file"></i> <span
                                        class="nav-label">{{_ "file_management"}}</span>
                                </a>
                            </li>

                            <li class="{{isActivePath regex='indexManagement'}}">
                                <a class="aNavigations" href="{{pathFor route='indexManagement'}}"><i
                                        class="fa fa-bolt"></i> <span
                                        class="nav-label">{{_ "index_management"}}</span>
                                </a>
                            </li>

                            <li class="{{isActivePath regex='adminQueries'}}">
                                <a class="aNavigations" href="{{pathFor route='adminQueries'}}"><i
                                        class="fa fa-key"></i> <span
                                        class="nav-label">{{_ "admin_queries"}}</span>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a href=""><i
                                class="fa fa-gears"></i> <span
                                class="nav-label">{{_ "tools"}}</span>
                            <span class="fa arrow"></span>
                        </a>

                        <ul class="nav nav-second-level collapse out">
                            <li class="{{isActivePath regex='shell'}}">
                                <a id="anchorShell" class="aNavigations" href="{{pathFor route='shell'}}"><i
                                        class="fa fa-window-maximize"></i> <span
                                        class="nav-label">{{_ "shell"}}</span>
                                </a>
                            </li>

                            <li class="{{isActivePath regex='aggregatePipeline'}}">
                                <a class="aNavigations" href="{{pathFor route='aggregatePipeline'}}"><i
                                        class="fa fa-tasks"></i> <span
                                        class="nav-label">{{_ "aggregate"}}</span>
                                </a>
                            </li>

                            <li class="{{isActivePath regex='storedFunctions'}}">
                                <a class="aNavigations" href="{{pathFor route='storedFunctions'}}"><i
                                        class="fa fa-suitcase"></i> <span
                                        class="nav-label">{{_ "stored_functions"}}</span>
                                </a>
                            </li>

                            <li class="{{isActivePath regex='schemaAnalyzer'}}">
                                <a id="anchorSchemaAnalyzer" class="aNavigations"
                                   href="{{pathFor route='schemaAnalyzer'}}"><i
                                        class="fa fa-braille"></i> <span
                                        class="nav-label">{{_ "schema_analyzer"}}</span>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a class="navCollectionTop" href=""><i class="fa fa-dashboard"></i> <span
                                class="nav-label">{{_ "collections"}}</span>
                            <span class="fa arrow pull-right"></span>

                            {{#if filtered}}
                                <span title="Filtered" style="margin-left: 15px"
                                      class="label label-info">{{_ "filtered"}}</span>
                            {{/if}}
                        </a>

                        <ul id="listCollectionNames" class="nav nav-second-level">
                            {{#each getCollectionNames}}
                                <li>
                                    <a class="navCollection {{#if equals type 'view'}}navView{{/if}}" href="{{pathFor route='browseCollection'}}"><i
                                            class="fa fa-book"></i> <span
                                            class="nav-label">{{name}}</span>
                                        {{#if equals type 'view'}}
                                            <span title="View" style="margin-left: 15px"
                                                  class="label label-info">{{_ "view"}}</span>
                                        {{/if}}
                                    </a>
                                </li>
                            {{/each}}
                        </ul>
                    </li>

                    {{#if getSystemCollectionNames}}
                        <li>
                            <a href="#"><i class="fa fa-server"></i> <span
                                    class="nav-label">{{_ "system"}}</span>
                                <span class="fa arrow pull-right"></span>
                            </a>

                            <ul id="listSystemCollections" class="nav nav-second-level collapse out">
                                {{#each getSystemCollectionNames}}
                                    <li>
                                        <a class="navCollection" href="{{pathFor route='browseCollection'}}"><i
                                                class="fa fa-book"></i> <span
                                                class="nav-label">{{name}}</span>
                                        </a>
                                    </li>
                                {{/each}}
                            </ul>
                        </li>
                    {{/if}}

                    <li>
                        <a href="#"><i class="fa fa-star"></i> <span
                                class="nav-label">{{_ "nosqlclient_skin"}}</span>
                            <span class="fa arrow pull-right"></span>
                        </a>

                        <ul class="nav nav-second-level collapse out">
                            <li>
                                <a id="skin-default" class="anchor-skin" href="#"><i
                                        class="fa fa-star"></i> <span
                                        class="nav-label">{{_ "skin_1"}}</span>
                                </a>
                            </li>
                            <li>
                                <a id="skin-1" class="anchor-skin" href="#"><i
                                        class="fa fa-star"></i> <span
                                        class="nav-label">{{_ "skin_2"}}</span>
                                </a>
                            </li>
                            <li>
                                <a id="skin-2" class="anchor-skin" href="#"><i
                                        class="fa fa-star"></i> <span
                                        class="nav-label">{{_ "skin_3"}}</span>
                                </a>
                            </li>
                            <li>
                                <a id="skin-3" class="anchor-skin" href="#"><i
                                        class="fa fa-star"></i> <span
                                        class="nav-label">{{_ "skin_4"}}</span>
                                </a>
                            </li>
                        </ul>
                    </li>
                    {{initializeMetisMenu}}
                {{/if}}
            </ul>
        </div>
    </nav>

    {{> filterCollection}}
    {{> addCollection}}
    {{> convertToCapped}}
    {{> renameCollection}}
    {{> validationRules}}
    {{> updateViewPipeline}}

</template>
